home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 February
/
Macworld (1999-02).dmg
/
Games World
/
Hot Demos!
/
DroidWorks demo
/
dwCD.gob
/
mission_cog_cap_floodlight.cog
< prev
next >
Wrap
Text File
|
1998-09-17
|
2KB
|
73 lines
# DroidWorks
# Infrared capability cog
#
# Floodlight ability is in inventory bin 11
# Power is in inventory bin 20
symbols
thing player
int actorFlags
message activated
message pulse
sound lightActivate=NRGt8InfraOn.wav local
sound lightDeactivate=NRGt8InfraOff.wav local
end
# ========================================================================================
code
activated:
player = GetSourceRef();
actorFlags = GetActorFlags(player);
if(GetInv(player, 11))
{
if(BitTest(actorFlags, 4) == 0)
{
if(GetInv(player, 20) > 0)
{
# Print("Floodlight activated");
SetActorFlags(player, 4);
SetInvActivated(player, 11, 1);
PlaySoundThing(lightActivate, player, 1.0, -1, -1, 0x80);
SetPulse(1.5);
}
else
{
# Print("No power for Floodlight");
PlaySoundThing(lightDeactivate, player, 1.0, -1, -1, 0x80);
}
}
else
{
# Print("Floodlight deactivated");
ClearActorFlags(player, 4);
SetInvActivated(player, 11, 0);
PlaySoundThing(lightDeactivate, player, 1.0, -1, -1, 0x80);
SetPulse(0);
}
}
return;
# ........................................................................................
pulse:
ChangeInv(player, 20, -15);
if(GetInv(player, 20) == 0)
{
# Print("No power for Floodlight");
ClearActorFlags(player, 4);
SetInvActivated(player, 11, 0);
PlaySoundThing(lightDeactivate, player, 1.0, -1, -1, 0x80);
SetPulse(0);
}
return;
end